<?php

namespace App\Services\Api;

/**
 * 获取文章分类列表接口
 */
class R50001
{
    public $apiCode = 'R#50001';
    public $pageNo = 1;
    public $pageSize = 10;
    public $title = '';
    public $domain = '';
    public $categoryId = '';

    public function getInitPostData($postData)
    {
        $data = [
            'pageNo' => $this->getPageNo(@$postData['pageNo']),
            'pageSize' => $this->getPageSize(@$postData['pageSize']),
            'domain' => $this->getDomain(@$postData['domain']),
            'title' => $this->getTitle(@$postData['title']),
            'categoryId' => $this->getCategoryId(@$postData['categoryId']),
        ];
        if (isset($postData['from'])) {
            $data['froms'] = $postData['from'];
        }
        return $data;
    }
    public function getPageNo($pageNo = '')
    {
        return $pageNo ? $pageNo : $this->pageNo;
    }

    public function getPageSize($pageSize = '')
    {
        return $pageSize ? $pageSize : $this->pageSize;
    }
    public function getTitle($title = '')
    {
        return $title ? $title : $this->title;
    }
    public function getDomain($domain = '')
    {
        return $domain ? $domain : $this->domain;
    }
    public function getCategoryId($categoryId = '')
    {
        return $categoryId ? $categoryId : $this->categoryId;
    }

    public function getInitApiCode()
    {
        return $this->apiCode;
    }

}
